-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Strip leading zeros in signature v and s values coming from the mirror node, in tests. #3241
Conversation
Signed-off-by: Eric Badiere <[email protected]>
Signed-off-by: Eric Badiere <[email protected]>
Quality Gate passedIssues Measures |
Test Results 18 files + 17 251 suites +242 32m 1s ⏱️ + 31m 24s For more details on these failures, see this check. Results for commit 4b5c0ba. ± Comparison against base commit 3bd07ef. ♻️ This comment has been updated with latest results. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3241 +/- ##
=======================================
Coverage 83.17% 83.17%
=======================================
Files 66 66
Lines 4314 4314
Branches 843 843
=======================================
Hits 3588 3588
Misses 483 483
Partials 243 243
Flags with carried forward coverage won't be shown. Click here to find out more. |
Description:
Test fix. Ethereum transaction signatures v and s values need to have leading zeros stripped before being evaluated.
Related issue(s):
Fixes #3239
Notes for reviewer:
Leading zeros on signature r and s values are stripped in the formatters.formatContractResult in the relay before the results are returned. On the mirror node they are stored with the leading zero. e.g.
The transaction hash
0xc5a3df675c99f634d9d81a8092fc65db54d7c28dc21126439329e92598976d2d
on testnet returns a signature s value of:0x091027721aff181da255f7bda0cf5b834a0d5099b46dc636b1dbd50a30e33383
from the mirror node.The eth_getTransactionReceipt response from the relay returns a signature s value of
0x91027721aff181da255f7bda0cf5b834a0d5099b46dc636b1dbd50a30e33383
The leading zeros in the v and s signature values will cause json: cannot unmarshal hex number with leading zero digits into Go struct field txJSON.s of type *hexutil.Big in the go-ethereum client.
Some tests verify the signature v and s values using the response from the mirror node, but these values need to strip the leading zeros before being evaluated.